package com.laf.manager.controller.dto;

import lombok.Data;
import org.springframework.jdbc.core.RowMapper;

import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @author ygl
 * @create 2019-01-04
 * @DESCRIPTION
 **/
@Data
public class MemberCarDto implements RowMapper<MemberCarDto>, Serializable {

    private int id;
    /**
     * 会员ID
     */
    private int memberId;
    /**
     * 会员姓名
     */
    private String memberName;
    /**
     * 车牌号
     */
    private String carNumber;

    @Override
    public MemberCarDto mapRow(ResultSet rs, int rowNum) throws SQLException {
        MemberCarDto model = new MemberCarDto();
        model.setId(rs.getInt("id"));
        model.setMemberId(rs.getInt("member_id"));
        model.setMemberName(rs.getString("member_name"));
        model.setCarNumber(rs.getString("car_number"));
        return model;
    }
}
